<#include "/lib/macro-lib.ftl"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<#include "../inc/commonJs.html">
<script src="../../js/calendar.js"></script>
</head>
<body>
<div align="center" class="easyui-panel" data-options='fit:true,border:false'>
<script language="javascript">
function formCheck(f){
	if (f.account.value == ""){
		alert("请填写帐户!");
		f.account.focus();
		return false;
	}
	if (f.logprice.value == ""){
		alert("请填写金额!");
		f.logprice.focus();
		return false;
	}
	if (f.type.value == ""){
		alert("请填写类型!");
		f.type.focus();
		return false;
	}
	if (f.user.value == ""){
		alert("请填写用户!");
		f.user.focus();
		return false;
	}
	return true;
}
function saveAndReturn() {
	var f = document.frm;
	if(formCheck(f)) {
		f.savetype.value = '1';
		f.submit();
	}
}
function addTip(t)
{
	//alert(t);
	var bz = document.frm.bz;
	bz.value = bz.value + t;
	bz.focus();
}
function clearTip()
{
	//alert(t);
	var bz = document.frm.bz;
	bz.value = '';
	bz.focus();
}
function Run(strPath)
{
	try{
		var objShell = new ActiveXObject("wscript.shell");
		objShell.Run(strPath);
		objShell = null;
	}catch(e){
		alert('找不到文件"'+strPath+'"(或它的组件之一)。请确定路径和文件名是否正确.')
	}
}
</script>
<br>
<table width="98%" border="0" cellpadding="4" cellspacing="0" class="table_all">
<form name="frm" method="post" action="logaddact.do" onSubmit="return formCheck(this)">
    <tr> 
      <td width="100" class="td_table_1">日期：</td>
      <td width="*" class="td_table_2"> 
        <input type="text" name="logtime" value="${cdate}" onclick="calendar.show(this);">
      </td>
    </tr>
    <tr> 
      <td width="100" class="td_table_1">账户：</td>
      <td width="*" class="td_table_2"> 
      <@radioUtil optName="account" optVals=accounts></@radioUtil>
      </td>
    </tr>
    <tr> 
      <td width="100" class="td_table_1">成员：</td>
      <td width="*" class="td_table_2"> 
        <@radioUtil optName="user" optVals=users></@radioUtil>
      </td>
    </tr>
    <tr> 
      <td width="100" class="td_table_1">类型：</td>
      <td width="*" class="td_table_2"> 
		<@selectUtil optName="type" optVals=types>onchange="document.frm.logprice.focus();"  class="easyui-combobox"</@selectUtil>      
	  </td>
    </tr>
    <tr> 
      <td width="100" class="td_table_1">金额：</td>
      <td width="*" class="td_table_2"> 
        <input type="text" name="logprice">&nbsp;&nbsp;
        <a href="javascript:Run('calc.exe');">[计算器]</a>
      </td>
    </tr>
    <tr> 
      <td width="100" class="td_table_1">备注：</td>
      <td width="*" class="td_table_2"> 
        <input type="text" name="bz" size=40>&nbsp;&nbsp;
        <a href="javascript:addTip('元/斤')">元/斤</a>&nbsp;&nbsp;
        <a href="javascript:clearTip();">[清空]</a>&nbsp;&nbsp;
      </td>
    </tr>
    <tr> 
      <td width="100" class="td_table_1">状态：</td>
      <td width="*" class="td_table_2"> 
        <select name="zt" class="easyui-combobox">        
        	<option value="1">启用</option>
        	<option value="0">禁用</option>
        </select>
      </td>
    </tr>
    <tr> 
      <td class="td_table_2">&nbsp;</td>
      <td class="td_table_2"> 
          <input type="submit" class="button_100px" value="保存并新增">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" class="button_100px"  value="保存到列表" onclick="saveAndReturn();">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" class="button_70px" value="返回列表" onclick="location='loglist.do';">
          <input type="hidden" value="0" name="savetype">
          <b>${ret!}</b>
      </td>
    </tr>
</form>
</table>
<script language="javascript">
</script>
</div>
</body>
</html>